
if Set('Talk') = 'ON'
   Set talk off
   cTalk = 'ON'
  else
   ctalk = 'OFF'
endif

m.AreaAnt = Select()

Select Par
= rlock()

m.ProxLan = Par.LncInicial

Select 0
Use Movmento again alias ProxMov order Num_Lanc

if m.ProxLan = 0
   m.ProxLan = 1
endif

do While Seek( m.ProxLan )
   m.ProxLan = m.ProxLan + 1
enddo
use

Select Par

Replace LncInicial with m.ProxLan + 1
unlock


Select (m.AreaAnt)
Set Talk &cTalk

Return m.ProxLan
